package cn.stylefeng.guns.modular.order.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.modular.order.model.OrderVerificationCode;
import cn.stylefeng.guns.modular.order.service.IOrderService;
import cn.stylefeng.guns.modular.order.service.IOrderVerificationCodeService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: 杨煜
 * @Date: 2019/12/11 13:17
 * @Description:
 */
@Controller
@RequestMapping("/orderVerificationCode")
public class OrderVerificationCodeController  extends BaseController {

    private String PREFIX = "/modular/orderVerificationCode/";

    @Autowired
    private IOrderVerificationCodeService orderVerificationCodeService;


    /**
     * 跳转到order首页
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "orderVerificationCode.html";
    }



    /**
     * 获取order列表
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String condition) {
        Page<Map<String, Object>> orders = orderVerificationCodeService.selectOrderVerificationCodes(condition);
        return LayuiPageFactory.createPageInfo(orders);
    }


}
